<?php

// make sure config.php exists
if (!file_exists(dirname(__FILE__) . '/config.php')) {
	echo 'config.php does not exist.';
	exit;
}

// include common.php, which sets up the VidoopSecure manager ($vs)
require_once dirname(__FILE__) . '/common.php';

// check that PHP and the config are valid
$issue = $vs->check_config();
if (!empty($issue)) {
	echo 'Configuration issue: ' . $issue;
	exit;
}

// check which services are available for the provided site credentials
$services = $vs->get_services();

if (empty($services)) {
	echo 'Your API information is incorrect.  Please fix config.php.';
} else {
	echo "<ul>";
	if (in_array('captcha', $services)) {
		echo '<li><a href="captcha.php">VidoopCAPTCHA demo</a></li>';
	}
	if (in_array('imageshield', $services)) {
		echo '<li><a href="enroll.php">ImageShield Enrollment demo</a>';
		if (!function_exists('json_encode')) {
			echo ' <b>WARNING</b> - PHP is compiled with --disable-json, so category selection will not work.';
		}
		echo '</li>';
	}
	echo "</ul>";
}


?>
